package erfgame.core.world.terrain;

public class GridEdge {

	private int edgeIndex;
	private int gridX;
	private int gridY;
	
	public GridEdge( int gridX, int gridY, int edgeIndex ) {
		this.gridX = gridX;
		this.gridY = gridY;
		this.edgeIndex = edgeIndex;
	}
	
	public int getEdgeIndex() {
		return this.edgeIndex;
	}
	
	public int getGridX() {
		return this.gridX;
	}
	
	public int getGridY() {
		return this.gridY;
	}

	@Override
	public boolean equals(Object obj) {
		if( obj instanceof GridEdge ) {
			return equals( (GridEdge)obj );
		} else {
			return false;
		}
	}
	
	public boolean equals( GridEdge e ) {
		return e.gridX == gridX && e.gridY == gridY && e.edgeIndex == edgeIndex;
	}

	@Override
	public int hashCode() {
		return (this.gridX << 10) + (this.gridY << 2) + this.edgeIndex;
	}
}
